package com.ycc.biz.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ycc.biz.common.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户表
 * @TableName sys_user
 */
@TableName(value ="sys_user")
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor(staticName = "instance")
@AllArgsConstructor
@Data
public class SysUser extends BaseEntity<SysUser> implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty("用户名")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Length(min = 6, message = "密码长度不能少于6位")
    @ApiModelProperty("密码")
    private String userPassword;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    @ApiModelProperty("手机号")
    private String phone;

    @ApiModelProperty("用户账号")
    private String userAccount;

}